import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-3*np.pi,3*np.pi,100)
y = np.sin(x)
plt.plot(x,y)
plt.grid(True)#显示网格线
plt.show()